package com.gmail.dengtao.joe.group.protocol.impl;

import java.util.Arrays;

import com.gmail.dengtao.joe.commons.util.ByteUtils;
import com.gmail.dengtao.joe.group.protocol.Protocol;

/**
 * custom data protocol...
 * @author <a href="mailto:joe.dengtao@gmail.com">DengTao</a>
 * @version 1.0
 * @since 1.0
 */
public class DATAProtocol implements Protocol {
	
	public static final int SYMBOL = 102;

	private byte[] data;

	public DATAProtocol(byte[] data) {
		super();
		this.data = (data == null ? ByteUtils.EMPTY_BYTE_ARRAY : data);
	}

	public byte[] getData() {
		return data;
	}

	@Override
	public String toString() {
		return "DATAProtocol [data=" + Arrays.toString(data) + "]";
	}
	
}